#include <func.h>

void *function(void *p)
{
    printf("i am a child\n");
    strcpy(p,"world");
}

int main()
{
    pthread_t pth;
    char *p=(char*)malloc(128);
    strcpy(p,"hello");
    int ret=pthread_create(&pth,NULL,function,p);
    if(ret!=0)
    {
        printf("pthread failed\n");
        return -1;
    }
    usleep(1);
    printf("i am parent\n");
    printf("%s\n",p);
    return 0;
}